import { Column, Entity, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { BaseEntity } from 'src/common/entities/base';
import { NotifyInfoFilesEntity } from './notify-info-files.entity';

@Entity('notify_info')
export class NotifyInfoEntity extends BaseEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id', comment: '通知ID' })
  public id: number;

  @Column({ type: 'varchar', name: 'notify_type', length: 255, comment: '通知类型' })
  public notifyType: string;

  @Column({ type: 'varchar', name: 'org_id', length: 36, comment: '组织UUID' })
  public orgId: string;

  @Column({ type: 'varchar', name: 'prj_id', length: 36, comment: '项目UUID' })
  public prjId: string;

  @Column({ type: 'varchar', name: 'sn', length: 255, comment: '设备SN' })
  public sn: string;

  @Column({ type: 'varchar', name: 'task_type', length: 255, comment: '任务类型' })
  public taskType: string;

  @Column({ type: 'text', name: 'tags', comment: '任务标签' })
  public tags: string;

  @Column({ type: 'varchar', name: 'task_id', length: 36, comment: '任务ID' })
  public taskId: string;

  @Column({ type: 'int', name: 'expected_file_count', comment: '预期文件数量' })
  public expectedFileCount: number;

  @Column({ type: 'int', name: 'uploaded_file_count', comment: '已上传文件数量' })
  public uploadedFileCount: number;

  @Column({ type: 'int', name: 'folder_id', comment: '文件夹ID' })
  public folderId: number;

  @OneToMany(() => NotifyInfoFilesEntity, files => files.notify)
  files: NotifyInfoFilesEntity[];
} 